package com.zhengxiang.onlinexamination.controller;

import com.zhengxiang.onlinexamination.base.AjaxResult;
import com.zhengxiang.onlinexamination.entity.ExamResult;
import com.zhengxiang.onlinexamination.entity.vo.ExamResultVo;
import com.zhengxiang.onlinexamination.entity.vo.PreviewPaperVo;
import com.zhengxiang.onlinexamination.service.ExamResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/examResult")
public class ExamResultController {

    @Autowired
    private ExamResultService examResultService;


    /**
     * 列表
     * */
    @PostMapping("/queryExamResultList")
    public AjaxResult queryExamResultList(@RequestBody ExamResultVo examResultVo){
        return AjaxResult.success(examResultService.queryExamResultList(examResultVo));

    }

    /**
     * 交卷
     * */
    @PostMapping("/handPaper")
    public AjaxResult handPaper(@RequestBody ExamResultVo examResultVo){
        examResultService.handPaper(examResultVo);
        return AjaxResult.success();
    }
    /**
     * 小程序端 改卷  全部一次计算结果
     * */
    @PostMapping("/correctExaminationPaper")
    public AjaxResult correctExaminationPaper(@RequestBody ExamResultVo examResultVo){
        examResultService.correctExaminationPaper(examResultVo);
        return AjaxResult.success();
    }
    /**
     * 考试结果
     * */
    @GetMapping("/getExamResultInfo")
    public AjaxResult getExamResultInfo(ExamResultVo examResultVo){
        return AjaxResult.success(examResultService.getExamResultInfo(examResultVo));
    }
    /**
     * 员工答题详情
     * */
    @GetMapping("/getExamResultInfoById")
    public AjaxResult getExamResultInfoById(ExamResultVo examResultVo){
        return AjaxResult.success(examResultService.getExamResultInfoById(examResultVo));
    }
}
